def bubble(L):
    print('start bubble sort:')
    print(L)
    count = 0
    while True:
        step = 0
        for i in range(len(L)-1):
            if L[i] > L[i+1]:
                L[i] ,L[i+1] = L[i+1], L[i]
                print(L)
                step += 1
                count += 1
        if(step == 0):
            return L, 'totalstep:', count
testlist = [27, 33, 28, 4, 2, 26, 13, 35, 8, 14]
print('final:', bubble(testlist))
